<!-- 订单物流发货 -->
<style>

    .order-delivery .layui-table{/*margin-bottom: 30px;*/}
    .layui-form #order_goods_list thead th, .layui-form #order_goods_list tbody tr{border-bottom: 1px solid #E6E6E6;}
    .layui-form #order_goods_list thead th{background-color: #F5F5F5;line-height: 30px;}

</style>
<!--发送订单弹出框-->
<script type="text/html" id="mrna_quit_audit_html">
    <div class="order-delivery">
        <div class="layui-form">

            <input type="hidden" value="{{ d.apply_id }}" name="apply_id"/>

            <div class="layui-form-item">
                <label class="layui-form-label">审核结果：</label>
                <div class="layui-input-block">
                    <input type="radio" lay-filter="quit_status" name="quit_status" value="2" title="审核通过" checked>
                    <input type="radio" lay-filter="quit_status" name="quit_status" value="3" title="审核驳回" >
                </div>
            </div>



            <div class="layui-form-item">
                <label class="layui-form-label">备注：</label>
                <div class="layui-input-block">
                    <textarea name="quitreason" class="layui-textarea"></textarea>
                </div>
            </div>


            <div class="ns-form-row">
                <button type="button" class="layui-btn" lay-submit id="button_quit_audit_mrna" lay-filter="button_quit_audit_mrna" style="display:none;">保存</button>
            </div>


        </div>
    </div>
</script>

<script>
    /**
     * 订单发货
     */
    var submitting = false;
    function mrnaQuitAudit(apply_id) {

        layui.use(['table', 'form', 'laytpl'], function () {
            var laytpl = layui.laytpl, table = layui.table, form = layui.form;
            form.render();
            //获取模板
            var getTpl = $("#mrna_quit_audit_html").html();
            //渲染模板
            var data = {'apply_id':apply_id};
            laytpl(getTpl).render(data, function (html) {
                layer.open({
                    type: 1,
                    shadeClose: true,
                    shade: 0.3,
                    fixed: false,
                    scrollbar: false,
                    title: "审核",
                    area: '800px',
                    btn: ['提交'],
                    yes: function (index, layero) {
                        $("#button_quit_audit_mrna").click();
                    },
                    content: html,
                    cancel: function (index, layero) {
                        //右上角关闭回调
                        layer.close(index);
                        //return false 开启该代码可禁止点击该按钮关闭
                    },
                    success: function (layero, index) {
                        form.render();

                        form.on('submit(button_quit_audit_mrna)', function (data) {

                            if (submitting) {
                                return false;
                            }
                            submitting = true;
                            $.ajax({
                                type: "post",
                                url: '{:addon_url("admin/mrna/applyQuitAudit")}',
                                async: true,
                                dataType: 'json',
                                data: data.field,
                                success: function (res) {
                                    if (res.code == 0) {
                                        layer.msg("审核成功");
                                        location.reload();
                                    } else {
                                        layer.msg(res.message);
                                        submitting = false;
                                    }
                                }
                            })
                        });

                    }

                });
            })

        })
    }


</script>